package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WhPrinterConfigMapper;
import com.ruoyi.system.domain.WhPrinterConfig;
import com.ruoyi.system.service.IWhPrinterConfigService;

import javax.annotation.Resource;

/**
 * 打印机配置Service业务层处理
 *
 * @author pangu
 * @date 2025-03-05
 */
@Service
public class WhPrinterConfigServiceImpl implements IWhPrinterConfigService {
    @Resource
    private WhPrinterConfigMapper whPrinterConfigMapper;

    /**
     * 查询打印机配置
     *
     * @param id 打印机配置主键
     * @return 打印机配置
     */
    @Override
    public WhPrinterConfig selectWhPrinterConfigById(Long id) {
        return whPrinterConfigMapper.selectWhPrinterConfigById(id);
    }

    /**
     * 查询打印机配置列表
     *
     * @param whPrinterConfig 打印机配置
     * @return 打印机配置
     */
    @Override
    public List<WhPrinterConfig> selectWhPrinterConfigList(WhPrinterConfig whPrinterConfig) {
        return whPrinterConfigMapper.selectWhPrinterConfigList(whPrinterConfig);
    }

    /**
     * 新增打印机配置
     *
     * @param whPrinterConfig 打印机配置
     * @return 结果
     */
    @Override
    public int insertWhPrinterConfig(WhPrinterConfig whPrinterConfig) {
        whPrinterConfig.setCreateTime(DateUtils.getNowDate());
        return whPrinterConfigMapper.insertWhPrinterConfig(whPrinterConfig);
    }

    /**
     * 修改打印机配置
     *
     * @param whPrinterConfig 打印机配置
     * @return 结果
     */
    @Override
    public int updateWhPrinterConfig(WhPrinterConfig whPrinterConfig) {
        whPrinterConfig.setUpdateTime(DateUtils.getNowDate());
        return whPrinterConfigMapper.updateWhPrinterConfig(whPrinterConfig);
    }

    /**
     * 批量删除打印机配置
     *
     * @param ids 需要删除的打印机配置主键
     * @return 结果
     */
    @Override
    public int deleteWhPrinterConfigByIds(Long[] ids) {
        return whPrinterConfigMapper.deleteWhPrinterConfigByIds(ids);
    }

    /**
     * 删除打印机配置信息
     *
     * @param id 打印机配置主键
     * @return 结果
     */
    @Override
    public int deleteWhPrinterConfigById(Long id) {
        return whPrinterConfigMapper.deleteWhPrinterConfigById(id);
    }
}
